<?php
/* @var $this PostsController */
/* @var $model Posts */

$this->breadcrumbs = array(
    'Posts' => array('index'),
    'Manage',
);

$this->menu = array(
    array('label' => 'List Posts', 'url' => array('index')),
    array('label' => 'Create Posts', 'url' => array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
		$.fn.yiiGridView.update('posts-grid', {
		data: $(this).serialize()
	});
//	return false;
});
");
?>

<div class="speedbar">
    <div class="speedbar-content">

        <ul class="menu-drop">
            <li><a href="#"><i class="icon-chevron-down"></i></a>
                <ul>
                    <li><a href="<?php echo Yii::app()->createUrl('admin/main/login'); ?>">Quản lý chung</a></li>
                    <li><a href="<?php echo Yii::app()->createUrl('admin/posts/update', array('id' => 40735020)); ?>">Bài viết giới thiệu</a></li>
                </ul>  
            </li>
        </ul>

        <ul class="menu-speedbar">
            <li><a href="<?php echo Yii::app()->createUrl('admin/posts/admin'); ?>" class="act_link">Quản lý bài viết</a></li>
            <li><a href="<?php echo Yii::app()->createUrl('admin/posts/create'); ?>">Tạo bài viết mới</a></li>
        </ul>
    </div>
</div>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'posts-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        'post_idfff' => 'post_id',
        'title',
        'desc',
        'picture',
        'status',
        'type',
//        array(
//            'name'=>'cat_id',
//            'value'=> '$data->cat->catNamebyId',
//            'filter'=>  Categrory::getCatlist(),
//        ),

        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
